package org.abratuhi.kvngroupware.server.mptua;

import java.util.ArrayList;

import org.abratuhi.kvngroupware.brainstorm.model.Brainstorm;
import org.abratuhi.kvngroupware.chat.model.Chatroom;
import org.abratuhi.kvngroupware.jokemanager.model.Joke;
import org.abratuhi.kvngroupware.network.Message;
import org.abratuhi.kvngroupware.scenario.model.Scenario;
import org.abratuhi.kvngroupware.server.model.KVNGroupwareServer;
import org.abratuhi.kvngroupware.team.model.Team;
import org.abratuhi.kvngroupware.user.model.User;
import org.jdom.Element;

public class ServerMPTUA {
	
	KVNGroupwareServer kvnserver;
	
	public  ServerMPTUA(KVNGroupwareServer kvnserver){
		this.kvnserver = kvnserver;
	}
	
	public void proceedMessage(Message message){
		System.out.println("MPTUA [recv]: "+message.toString()); // TODO: logger
		Element request = (Element) message.getRoot().getChild("request");
		String type = request.getAttributeValue("type");
		String action = request.getAttributeValue("action");
		
		if(type.equals("user")){
			proceedUserMessage(request, type, action);
		}
		else if(type.equals("team")){
			proceedTeamMessage(request, type, action);
		}
		else if(type.equals("brainstorm")){
			proceedBrainstormMessage(request, type, action);
		}
		else if(type.equals("chatroom")){
			proceedChatroomMessage(request, type, action);
		}
		else if(type.equals("joke")){
			proceedJokeMessage(request, type, action);
		}
		else if(type.equals("scenario")){
			proceedScenarioMessage(request, type, action);
		}
		else if(type.equals("scenario_joke")){
			proceedScenarioJokeMessage(request, type, action);
		}
		
	}
	
	private void proceedUserMessage(Element request, String type, String action) {
		
	}

	private void proceedTeamMessage(Element request, String type, String action) {
		
	}

	private void proceedJokeMessage(Element request, String type, String action) {
		
	}

	private void proceedScenarioMessage(Element request, String type, String action) {
		
	}

	private void proceedScenarioJokeMessage(Element request, String type, String action) {
		
	}
	
	void proceedBrainstormMessage(Element request, String type, String action){
	}
	
	void proceedChatroomMessage(Element request, String type, String action){
	}
	
}
